<style lang="less">

  .div-order-manage-sty {
    height: 92%;
    display: flex;
    .el-table .info-row {
      background: #FFAEB9;
    }
    .el-row {
      margin-bottom: 20px;
      &:last-child {
        margin-bottom: 0;
      }
    }

    .at {
      display: none;
    }

    .el-col {
      border-radius: 4px;
    }

    .bg-purple {
      background: #ffffff;
    }

    .grid-content {
      border-radius: 4px;
      min-height: 36px;
    }

    .el-button {
      width: 100%;
      margin: auto;
    }

    .el-col-2 {
      text-align: center;
    }

    .f-b1 {
      border-top: 1px solid #c8c8c8;
      /*border-left: 1px solid #c8c8c8;*/
      /*border-right: 1px solid #c8c8c8;*/
      line-height: 36px;
      margin-bottom: 0;
    }

    .f-bb1 {
      border-bottom: 1px solid #c8c8c8;
    }

    .f-bo {
      border: 0;
    }

    .f-w70 {
      width: 70%;
    }

    .f-mb {
      margin-bottom: 0;
    }

    .f-fr {
      float: right;
    }

    .f-wa {
      width: auto;
    }

    .f-mt {
      margin-top: 20px;
    }

    .f-mt10 {
      margin-top: 10px;
    }

    .f-mr20 {
      margin-right: 20px;
    }

    .f-ml10 {
      margin-left: 10px;
    }

    .f-mr10 {
      margin-right: 10px;
    }

    .f-bc {
      background: #eef1f6;
    }

    .div-content-sty {
      width: 99%;
      float: right;
    }

    .f-mb10 {
      margin-bottom: 10px;
    }

    li {
      list-style-type: none;
    }

    .f-mt5 {
      margin-top: 5px;
    }

    .f-mb5 {
      margin-bottom: 5px;
    }

    .f-mr5 {
      margin-right: 5px;
    }

    .f-tc {
      color: #20a0ff;
    }

    .f-txc {
      text-align: center;
    }

    .f-pa {
      position: absolute;
    }

    .f-w20 {
      width: 20px;
    }

    .f-h20 {
      height: 20px;
    }
    .excellent-route-sty{
      color: white;  background-color:#66B1FF;width: 35px;display: inline-block;margin-left: 5px;text-align: center;line-height:19px
    }
  }
</style>
<template>
  <div class="div-order-manage-sty">
    <el-row>
      <el-col :span="2" style="height: 100%">
        <el-row>
          <el-button type="primary" @click="orderEnteringClick">订单录入</el-button>
        </el-row>
        <el-menu default-active="NOTEQ_isDelete=111002001;" class="el-menu-vertical-demo"
                 @select="searchOrdersByOrderStatus">
          <el-menu-item index="NOTEQ_isDelete=111002001;">所有订单 [{{orderNumbers.all}}]</el-menu-item>
          <!--<el-menu-item index="EQ_orderStatus=101001001;EQ_isDelete=111002002;">待提交 [{{orderNumbers.dtj}}]-->
          <!--</el-menu-item>-->
          <el-menu-item index="EQ_orderStatus=101001002;EQ_isDelete=111002002;">待确认 [{{orderNumbers.dqr}}]
          </el-menu-item>
          <!--<el-menu-item index="EQ_payStatus=101003001;NOTEQ_isDelete=111002001">待支付 [{{orderNumbers.dzf}}]-->
          <!--</el-menu-item>-->
          <el-menu-item index="EQ_orderStatus=101001003;">待分派 [{{orderNumbers.dfp}}]</el-menu-item>
          <el-menu-item index="EQ_orderStatus=101001004;EQ_extractType=105002001;">待提货 [{{orderNumbers.dth}}]
          </el-menu-item>
          <el-menu-item index="EQ_orderStatus=101001005;">待发运 [{{orderNumbers.dfy}}]</el-menu-item>
          <el-menu-item index="EQ_orderStatus=101001006;">待签收 [{{orderNumbers.dqs}}]</el-menu-item>
          <el-menu-item index="EQ_orderStatus=101001007;">待评价 [{{orderNumbers.dpj}}]</el-menu-item>
          <el-menu-item index="EQ_orderStatus=101001011;">已完成 [{{orderNumbers.ywc}}]</el-menu-item>
          <el-menu-item index="EQ_isDelete=111002001;">回收站 [{{orderNumbers.hsz}}]</el-menu-item>
        </el-menu>
      </el-col>
      <el-col :span="22">
        <div class="grid-content bg-purple div-content-sty f-mb10">
          <ue-search-bar ref="ueSearchBar" v-model="searchForm" :data="querys" label-width="120px">
          </ue-search-bar>
          <div class="f-mt f-wa">
            <!--待提交-->
            <el-button type="primary" class="f-wa" v-bind:class="{ at: isAwaitSubmit }"
                       @click="orderReverse(orderIds,101001002,101001001,'订单提交成功')"
                       v-if="btns.indexOf('submit_btn')>-1">提交
            </el-button>
            <el-button type="primary" class="f-wa f-ml10" v-bind:class="{ at: isAwaitSubmit }"
                       @click="deleteOrder(orderIds,111002001,'您确定要删除该订单','订单删除成功')"
                       v-if="btns.indexOf('delete_btn')>-1">删除
            </el-button>
            <!--待确认-->
            <el-button type="primary" class="f-wa f-ml10" v-bind:class="{ at: isAwaitAssert }"
                       @click="updateOrderStatus(orderIds,101001003,101001002,'订单确认成功')"
                       v-if="btns.indexOf('affirm_btn')>-1">确认
            </el-button>
            <el-button type="primary" class="f-wa f-ml10" v-bind:class="{ at: isAwaitAssert }"
                       @click="orderAssignDialog(orderIds,101001003,101001002,'订单确认&分派成功')"
                       v-if="btns.indexOf('affirm_assign_btn')>-1">确认&分派
            </el-button>
            <el-button type="primary" class="f-wa f-ml10" v-bind:class="{ at: isAwaitAssert }"
                       @click="orderReverse(orderIds,101001001,101001002,'订单取消成功')"
                       v-if="btns.indexOf('cancel_btn')>-1">取消
            </el-button>
            <el-button type="primary" class="f-wa f-ml10" v-bind:class="{ at: isAwaitAssert }"
                       @click="seOrderReceptionEnteringDialog(orderIds)"
                       v-if="btns.indexOf('reception_entering_btn')>-1">接待录入
            </el-button>
            <!--待支付-->
            <el-button type="primary" class="f-wa f-ml10" v-bind:class="{ at: isAwaitPay }"
                       v-if="btns.indexOf('affirm_pay_btn')>-1">确认支付
            </el-button>
            <!--待分派-->
            <el-button type="primary" class="f-wa f-ml10" v-bind:class="{ at: isAwaitAssign }"
                       @click="orderAssignDialog(orderIds,'',101001003,'订单分派成功')"
                       v-if="btns.indexOf('assign_order_btn')>-1">分派订单
            </el-button>
            <!--回收站-->
            <el-button type="primary" class="f-wa f-ml10" v-bind:class="{ at: isDelete }"
                       @click="deleteOrder(orderIds,'notarizeDelete','您确定要删除该订单','订单删除成功')"
                       v-if="btns.indexOf('affirm_delete_btn')>-1">确认删除
            </el-button>
            <el-button type="primary" class="f-wa f-ml10" v-bind:class="{ at: isDelete }"
                       @click="deleteOrder(orderIds,111002002,'您确定要还原该订单','订单还原成功')"
                       v-if="btns.indexOf('restore_btn')>-1">还原
            </el-button>
            <!--修改订单-->
            <el-button type="primary" class="f-wa f-ml10" v-if="btns.indexOf('modify_order_btn')>-1"
                       v-bind:class="{ at: isModify }"
                       @click="orderModifyClick(orderIds)">修改订单
            </el-button>
            <!--取消分派&取消确认-->
            <el-button type="primary" v-bind:class="{ at: isAwaitExtract }"
                       v-if="btns.indexOf('cancel_assign_btn')>-1" class="f-wa f-ml10"
                       @click="cancelAssignv2()">取消分派
            </el-button>
            <el-button v-bind:class="{ at: isAwaitAssign }" type="primary"
                       v-if="btns.indexOf('cancel_affirm_btn')>-1" class="f-wa f-ml10"
                       @click="cancelAffirmv2()">取消确认
            </el-button>

            <el-button type="primary" class="f-wa f-fr f-ml10 f-mr20"
                       @click="$refs.ueSearchBar.reset()">重置
            </el-button>
            <el-button type="primary" class="f-wa f-fr f-ml10 " @click="searchOrders">查询</el-button>
            <el-button :disabled="orderIds.length === 0" type="primary" class="f-wa f-fr f-ml10 "
                       @click="printLabelOrder" v-if="btns.indexOf('tag_print_btn')>-1">标签打印
            </el-button>
            <el-button :disabled="orderIds.length === 0" type="primary" class="f-wa f-fr f-ml10 "
                       @click="lodopOrder(currentLodopLeft,currentLodopTop)" v-if="btns.indexOf('print_btn')>-1">套打
            </el-button>
            <el-button type="primary" class="f-wa f-fr f-ml10 " @click="lodopInvoke"
                       v-if="btns.indexOf('print_adjustment_btn')>-1">套打调整
            </el-button>
            <el-button type="primary" @click="orderExport" class="f-wa f-fr f-ml10"
                       v-if="btns.indexOf('export_btn')>-1">导出
            </el-button>
            <el-button type="primary" class="f-wa f-fr f-ml10" v-if="btns.indexOf('import_btn')>-1">导入</el-button>
          </div>
        </div>
        <div class="grid-content bg-purple div-content-sty f-mb10">
          <el-table :data="orderTableData" height="650" border @selection-change="scOrders"
                    :row-class-name="tableRowClassName">
            <el-table-column type="selection" width="55">
            </el-table-column>
            <el-table-column prop="date" label="订单信息" width="250">
              <template slot-scope="scope">
                <li class="f-font-20 f-mb5">
                  <div style="display: inline-block">
                    <a style="cursor: pointer;text-decoration:underline;color: #20a0ff"
                       @click="orderSelectDialog(scope.row)">
                      {{scope.row.orderNumber}}
                    </a>
                  </div>
                  <div style="display: inline-block;margin-left: 10px">
                    <!--<div v-if="scope.row.orderStatus !== 101001001" style="display: inline-block;margin-left: 10px">-->
                    <label v-if="scope.row.noticeDeliveryStatus === 101022002"
                           style="cursor: pointer;color: #FF7467;border: 1px solid #FF7467;padding-left: 2px;padding-right: 2px"
                    >等通知放货</label>
                    <label v-if="scope.row.noticeDeliveryStatus === 101022003"
                           style="cursor: pointer;color: #52B436;border: 1px solid #52B436;padding-left: 2px;padding-right: 2px">已确认放货</label>
                  </div>
                </li>
                <li>
                  {{scope.row.shipmentsProvince}}{{scope.row.shipmentsCity}}{{scope.row.shipmentsCounty}}{{scope.row.shipmentsTown}}
                  <img src="../../assets/start-address.gif" class="f-w20 f-h20 f-pa">
                </li>
                <li>
                  {{scope.row.sendProvince}}{{scope.row.sendCity}}{{scope.row.sendCounty}}{{scope.row.sendTown}}
                  <img src="../../assets/end-address.gif" class="f-w20 f-h20 f-pa">
                </li>
                <li v-if="scope.row.excellentRouteServiceDetailNames">
                  <div v-for="(item,index) in (scope.row.excellentRouteServiceDetailNames.split(','))" class="excellent-route-sty" :key="index">
                    {{item}}
                  </div>
                </li>
              </template>
            </el-table-column>
            <el-table-column prop="name" label="计划时间" width="250">
              <template slot-scope="scope">
                <li>提交时间&nbsp;&nbsp;{{scope.row.createDate}}</li>
                <li>
                  发运日期&nbsp;&nbsp;{{scope.row.shipmentsDate}}
                </li>
                <li v-if="scope.row.extractType===105002001">
                  计划提货&nbsp;&nbsp;{{scope.row.extractDate}} {{scope.row.extractTime}}
                </li>
                <li v-if="scope.row.extractType===105002002">
                  {{scope.row.extractTypeName}}&nbsp;&nbsp;{{scope.row.startNetWorkName}}
                </li>
                <li v-if="scope.row.sendType===105001001">计划送抵&nbsp;&nbsp;{{scope.row.sendTime}}</li>
                <li v-if="scope.row.sendType===105001002">
                  {{scope.row.sendTypeName}}&nbsp;&nbsp;{{scope.row.endNetWorkName}}
                </li>
              </template>
            </el-table-column>
            <el-table-column prop="address" label="货物信息" width="110">
              <template slot-scope="scope">
                <div class="f-txc">
                  <li v-if="scope.row.orderCargos.length>0">{{scope.row.orderCargos[0].cargoName}}&nbsp;&nbsp;</li>
                  <li v-if="scope.row.orderCargos.length>0">{{scope.row.orderCargos[0].amount}}&nbsp;&nbsp;件</li>
                  <li v-if="scope.row.orderCargos.length>0">{{scope.row.orderCargos[0].weight}}&nbsp;&nbsp;吨
                  </li>
                  <li v-if="scope.row.orderCargos.length>0">{{scope.row.orderCargos[0].volume}}&nbsp;&nbsp;方
                  </li>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="address" label="订单金额（元）" width="120">
              <template slot-scope="scope">
                <div class="div-w100 f-tc f-txc">
                  <li>{{scope.row.paymentTypeName}}</li>
                  <li class="f-c-red f-mt10">{{scope.row.orderPrice}}元</li>
                  <li class="f-mt10" style="color: red">{{scope.row.payStatusName}}</li>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="address" label="发货人信息" width="240">
              <template slot-scope="scope">
                <li>
                  发货客户：{{scope.row.memberUserName}}
                </li>
                <li>
                  {{scope.row.shipmentsContactName}}
                </li>
                <li>
                  {{scope.row.shipmentsContactPhone}}
                  <label
                    v-if="scope.row.shipmentsContactPhone!=''&&scope.row.shipmentsContactPhone!=null&&scope.row.shipmentsContactPhone!=undefined&&scope.row.shipmentsTelephone!=''&&scope.row.shipmentsTelephone!=null&&scope.row.shipmentsTelephone!=undefined">,</label>
                  {{scope.row.shipmentsTelephone}}
                </li>
                <li>
                  {{scope.row.shipmentsStreet}}
                </li>
              </template>
            </el-table-column>
            <el-table-column prop="address" label="收货人信息" width="240">
              <template slot-scope="scope">
                <li>
                  {{scope.row.sendContactName}}
                </li>
                <li>
                  {{scope.row.sendContactPhone}}
                  <label
                    v-if="scope.row.sendContactPhone!=''&&scope.row.sendContactPhone!=null&&scope.row.sendContactPhone!=undefined&&scope.row.sendTelephone!=''&&scope.row.sendTelephone!=null&&scope.row.sendTelephone!=undefined">,</label>
                  {{scope.row.sendTelephone}}
                </li>
                <li>
                  {{scope.row.sendStreet}}
                </li>
              </template>
            </el-table-column>
            <el-table-column prop="address" label="状态" width="100">
              <template slot-scope="scope">
                <li>
                  {{scope.row.orderStatusName}}
                </li>
                <li>
                  {{scope.row.agingName}}
                </li>
                <li v-if="scope.row.affirmPrice" style="color: red;border: 1px dotted red;padding: 2px">
                  专线已审核<br>价格:{{scope.row.affirmPrice}}元
                </li>
              </template>
            </el-table-column>
            <el-table-column prop="address" label="操作">
              <template slot-scope="scope">
                <!--等通知放货-放货确认-->
                <el-button type="primary"
                           v-if="btns.indexOf('affirm_release_cargo')>-1 &&
                           scope.row.orderStatus !== 101001001&&
                           scope.row.noticeDeliveryStatus === 101022002&&
                           scope.row.isDelete === 111002002"
                           class="f-wa f-ml10 f-mt5 f-mb5"
                           @click="openAffirmReleaseDialog(scope.row.id,scope.row.orderStatus)">放货确认
                </el-button>
                <!--待提交-->
                <el-button type="primary"
                           v-if="btns.indexOf('submit_btn')>-1 &&
                           scope.row.orderStatus === 101001001&&
                           scope.row.isDelete === 111002002"
                           class="f-wa f-ml10 f-mt5 f-mb5"
                           @click="orderReverse(scope.row.id,101001002,101001001,'订单提交成功')">提交
                </el-button>
                <el-button type="primary"
                           v-if="btns.indexOf('delete_btn')>-1 &&
                           (scope.row.orderStatus === 101001001||scope.row.orderStatus === 101001002)&&
                           scope.row.isDelete === 111002002"
                           class="f-wa f-ml10 f-mt5 f-mb5"
                           @click="deleteOrder(scope.row.id,111002001,'您确定要删除该订单','订单删除成功')">删除
                </el-button>
                <!--待确认-->
                <el-button type="primary" v-if="btns.indexOf('affirm_btn')>-1 &&
                scope.row.orderStatus === 101001002&&
                scope.row.isDelete === 111002002"
                           class="f-wa f-ml10 f-mt5 f-mb5"
                           @click="updateOrderStatus(scope.row.id,101001003,101001002,'订单确认成功')">确认
                </el-button>
                <el-button type="primary"
                           v-if="btns.indexOf('cancel_btn')>-1 &&
                           scope.row.orderStatus === 101001002&&
                           scope.row.isDelete === 111002002&&
                           scope.row.payStatus === 101003001"
                           class="f-wa f-ml10 f-mt5 f-mb5"
                           @click="orderReverse(scope.row.id,101001001,101001002,'订单取消成功')">取消
                </el-button>
                <el-button type="primary"
                           v-if="btns.indexOf('reception_entering_btn')>-1 &&
                           scope.row.orderStatus === 101001002&&
                           scope.row.isDelete === 111002002"
                           class="f-wa f-ml10 f-mt5 f-mb5" @click="rowOrderReceptionEnteringDialog(scope.row.id)">接待录入
                </el-button>
                <!--修改订单-->
                <el-button type="primary"
                           v-if="btns.indexOf('modify_order_btn')>-1 &&
                           scope.row.orderStatus !== 101001001&&
                           scope.row.orderStatus !== 101001002&&
                           scope.row.orderStatus !== 101001011&&
                           scope.row.isDelete === 111002002"
                           class="f-wa f-ml10 f-mt5 f-mb5" @click="orderModifyCli(scope.row.id)">修改订单
                </el-button>
                <el-button type="primary" v-if="btns.indexOf('affirm_assign_btn')>-1 &&
                scope.row.orderStatus === 101001002&&
                scope.row.agingDictEntityId !== 112006004&&
                scope.row.isDelete === 111002002"
                           class="f-wa f-ml10 f-mt5 f-mb5"
                           @click="orderAssignDialog(scope.row,'row',101001002,'订单确认&分派成功')">确认&分派
                </el-button>
                <!--待分派-->
                <el-button type="primary"
                           v-if="btns.indexOf('assign_order_btn')>-1 &&scope.row.orderStatus === 101001003&&scope.row.agingDictEntityId !== 112006004"
                           class="f-wa f-ml10 f-mt5 f-mb5"
                           @click="orderAssignDialog(scope.row,'row',101001003,'订单分派成功')">分派订单
                </el-button>
                <!--回收状态-->
                <el-button type="primary"
                           v-if="btns.indexOf('affirm_delete_btn')>-1 &&
                           scope.row.isDelete === 111002001&&
                           (scope.row.orderStatus === 101001001||scope.row.orderStatus === 101001002)"
                           class="f-wa f-ml10 f-mt5 f-mb5"
                           @click="deleteOrder(scope.row.id,'notarizeDelete','您确定要删除该订单','订单删除成功')">确认删除
                </el-button>
                <el-button type="primary"
                           v-if="btns.indexOf('restore_btn')>-1 &&
                           scope.row.isDelete === 111002001&&
                           (scope.row.orderStatus === 101001001||scope.row.orderStatus === 101001002)"
                           class="f-wa f-ml10 f-mt5 f-mb5"
                           @click="deleteOrder(scope.row.id,111002002,'您确定要还原该订单','订单还原成功')">还原
                </el-button>
                <el-button type="primary"
                           v-if="btns.indexOf('refund_btn')>-1 &&
                           scope.row.orderStatus !== 101001001 &&
                           scope.row.payStatus === 101003002 &&
                           scope.row.isDelete === 111002002"
                           class="f-wa f-ml10 f-mt5 f-mb5"
                           @click="orderRefund(scope.row.id)">一键退款
                </el-button>
                <!--取消分派&取消确认-->
                <el-button type="primary"
                           v-if="btns.indexOf('cancel_assign_btn')>-1 &&
                            (scope.row.orderStatus === 101001004||
                            scope.row.orderStatus === 101001005||
                            scope.row.orderStatus === 101001006||
                            scope.row.orderStatus === 101001011) &&
                             scope.row.showAssign"
                           class="f-wa f-ml10 f-mt5 f-mb5" @click="cancelAssign(scope.row.id,scope.row.orderNumber)">
                  取消分派
                </el-button>
                <el-button type="primary"
                           v-if="btns.indexOf('cancel_affirm_btn')>-1 && scope.row.orderStatus === 101001003"
                           class="f-wa f-ml10 f-mt5 f-mb5" @click="cancelAffirm(scope.row.id,scope.row.orderNumber)">
                  取消确认
                </el-button>
              </template>
            </el-table-column>
          </el-table>
          <el-col class="f-mt10" :span="24">
            <el-pagination
              :current-page="currentPage"
              :page-size="pageSize"
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              layout="total,sizes,prev,pager,next,jumper"
              :total="total" style="float: right">
            </el-pagination>
          </el-col>
        </div>
      </el-col>
    </el-row>

    <!--分派订单Dialog-->
    <el-dialog title="选择调度中心" :visible.sync="selectDispatchCentre" size="tiny">
      <el-table :data="dispatchCentreData" :show-header="false">
        <el-table-column property="organizationName" label="名称"></el-table-column>
        <el-table-column property="address" label="地址">
          <template slot-scope="scope">
            <div slot="footer" class="f-fr">
              <el-button class="f-wa" type="text" v-loading="seLoading"
                         @click.stop="orderAssignAndPayableAndTask(scope.row)">选择
              </el-button>
            </div>
          </template>
        </el-table-column>
      </el-table>

      <div slot="footer">
        <el-button class="f-wa" @click.native="selectDispatchCentre = false">取消</el-button>
      </div>
    </el-dialog>

    <!--接待录入Dialog-->
    <el-dialog title="接待录入" :visible.sync="receptionEntering" size="large">
      <order-reception-entering :title="orderId"></order-reception-entering>
    </el-dialog>

    <!--套打调整-->
    <el-dialog title="套打调整" size="tiny" :visible.sync="lodopvisible" :close-on-click-modal="false">
      <el-form label-width="150px">
        <el-row class="f-mt10 f-mb10">
          <el-col :span="24">
            <el-form-item label="套打LEFT(默认为-13)" class="width70">
              <el-input step="1" v-model.number="currentLodopLeft" style="width: 220px" auto-complete="off"
                        type="number"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row class="f-mt10 f-mb10">
          <el-col :span="24">
            <el-form-item label="套打TOP(默认为-2)" class="width70">
              <el-input step="1" v-model.number="currentLodopTop" style="width: 220px" auto-complete="off"
                        type="number"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer" style="width: 30%;float: right">
        <el-button @click.native="lodopvisible = false">取消</el-button>
        <el-button type="primary" @click.native="saveLotopInvoke" style="float: right">提交</el-button>
      </div>
    </el-dialog>

    <!--订单录入Dialog-->
    <el-dialog title="订单录入" style="top: 5%;" :visible.sync="orderEnteringDialog" size="large">
      <order-entering></order-entering>
    </el-dialog>

    <!--订单查看Dialog-->
    <el-dialog title="订单查看" :visible.sync="orderSelect" width="80%">
      <order-select :title="orderSelectForm"></order-select>
    </el-dialog>

    <!--取消分派&取消确认Dialog-->
    <el-dialog :title="cancelDialogTitle" :visible.sync="cancelDialog" size="tiny">
      <el-form ref="cancelDialogForm" :model="cancelDialogForm" label-width="80px">
        <el-form-item label="">
          <label v-html="titleMsg"></label>
        </el-form-item>
        <el-form-item label="取消理由">
          <el-input type="textarea" v-model="cancelDialogForm.receptionDescribe"></el-input>
        </el-form-item>
        <el-form-item style="float: right">
          <el-button style="width: auto" type="primary" @click="createClick">确认</el-button>
          <el-button style="width: auto" @click="cancelDialog=false">取消</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>

    <!--等通知放货订单的确认放货弹窗-->
    <el-dialog title="放货确认" :visible.sync="affirmReleaseDialogVisible" size="tiny" @close="closeAffirmReleaseDialog">
      <el-form :key="dialogKey" :model="affirmReleaseForm" ref="affirmReleaseForm">
        <el-form-item label="放货确认时间" prop="affirmReleaseDatePickerTime" :label-width="dialogFormLabelWidth">
          <el-date-picker
            :rules="[{ required: true, message: '选择确认放货时间', trigger: 'blur' }]"
            style="width: 220px"
            format="yyyy-MM-dd HH:mm:SS"
            v-model="affirmReleaseDatePickerTime"
            type="datetime"
            placeholder="选择日期时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="确认人" prop="affirmReleasePerson" :label-width="dialogFormLabelWidth">
          <el-input v-model="affirmReleaseForm.affirmReleasePerson" style="width: 220px" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="放货备注" prop="remark" :label-width="dialogFormLabelWidth">
          <el-input type="textarea" v-model="affirmReleaseForm.affirmReleaseRemark" :rows="4" placeholder="请输入内容"
                    style="width: 220px"></el-input>
        </el-form-item>
        <el-form-item style="float: right">
          <el-button style="width: auto" @click="closeAffirmReleaseDialog">取消</el-button>
          <el-button style="width: auto" type="primary" @click="submitAffirmRelease">确认</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>

  </div>
</template>
<script>
/* eslint-disable indent,quotes,no-undef,no-unused-vars,spaced-comment */

  import { getLodop } from '../../api/lodop/LodopFuncs.js';
  import { doOrderRefund } from '../../api/pay/pay.js';
  import {
    getOrderIdByLodop,
    getOrderTableData,
    orderReverse,
    updateOrderStatus,
    orderAssignAndPayableAndTask,
    deleteOrder,
    notarizeDeleteOrder, searchOrderNumbers,
    searchOrdersNoPage,
    affirmRelease
  } from '../../api/order/order.js';
  import { getDictEntityByDictCode } from '../../api/system/Dict.js';
  import { searchMarkCargoNoPage } from '../../api/system/MarkCargo.js';
  import { isEmpty, objToFilter } from '../../lib/util.js';
  import OrderEntering from './OrderEnteringDialog.vue';
  import OrderSelect from './OrderSelectDialog.vue';
  import ReceptionEntering from './ReceptionEntering.vue';
  import { saveOrderReceptions } from '../../api/order/receptionEntering.js';

  export default {
    components: {
      'order-select': OrderSelect,
      'order-reception-entering': ReceptionEntering
    },
    data () {
      return {
        cancelDialogForm: {
          receptionDescribe: '',
          receptionType: '',
          receptionTypeId: ''
        },
        cancelDialog: false,
        cancelDialogTitle: '取消确认',
        token: this.$store.state.token,
        fs: '',
        orderSelectForm: {},
        orderId: '',
        titleMsg: '',
        isModify: true,
        isAwaitSubmit: true,
        isAwaitAssert: true,
        isAwaitPay: true,
        isAwaitAssign: true,
        isAwaitExtract: true,
        isDelete: true,
        orderEnteringDialog: false,
        orderSelect: false,
        selectDispatchCentre: false,
        refresh: '',
        feedbackTracking: false,
        lodopvisible: false,
        receptionEntering: false,
        seLoading: false,
        logisticsStatusForm: {},
        searchForm: {},
        orderSources: [],
        multipleSelection: [],
        orderNumbers: {
          all: '',
          dtj: '', // 代提交
          dqr: '', // 待确认
          dzf: '', // 待支付
          dfp: '', // 待分派
          dth: '', // 待提货
          dfy: '', // 待发运
          dqs: '', // 待签收
          dpj: '', // 待评价
          ywc: '', // 已完成
          hsz: ''// 回收站
        },
        total: 0,
        currentPage: 1,
        pageSize: 10,
        orderTableData: [],
        dispatchCentreData: [],
        orderIds: [],
        orderAging: [],
        orderRowData: [],
        currentLodopLeft: -13,
        currentLodopTop: -2,
        orderShipments: {
          shipmentsProvinceId: '',
          shipmentsCityId: '',
          shipmentsCountyId: ''
        },
        // 等通知放货-确认放货弹窗
        affirmReleaseDialogVisible: false,
        dialogFormLabelWidth: '140px',
        dialogKey: 0,
        submitLoading: false,
        affirmReleaseDatePickerTime: null,
        affirmReleaseForm: {
          id: null,
          noticeDeliveryStatus: 101022003,
          affirmReleaseTime: null,
          affirmReleasePerson: null,
          affirmReleaseRemark: null
        }
      };
    },
    methods: {
      // 放货确认弹窗
      openAffirmReleaseDialog (orderId, orderStatus) {
        this.AffirmReleaseOrderStatus = orderStatus;
        this.affirmReleaseDialogVisible = true;
        this.affirmReleaseForm.id = orderId;
        this.dialogKey = Math.random() - 0.5;
      },
      closeAffirmReleaseDialog () {
        this.affirmReleaseDialogVisible = false;
        this.affirmReleaseDatePickerTime = null;
        this.affirmReleaseForm = {
          id: null,
          noticeDeliveryStatus: 101022003,
          affirmReleaseTime: null,
          affirmReleasePerson: null,
          affirmReleaseRemark: null
        };
      },
      submitAffirmRelease () {
        this.$refs['affirmReleaseForm'].validate((valid) => {
          if (valid) {
            this.submitLoading = true;
            this.affirmReleaseForm.affirmReleaseTime = this.affirmReleaseDatePickerTime.toJSON();
            affirmRelease(this.token, this.affirmReleaseForm).then(res => {
              this.submitLoading = false;
              if (res.data.successFlg) {
                this.$message.success('确认放货成功！');
                this.closeAffirmReleaseDialog();
                this.searchOrdersByOrderStatus('EQ_orderStatus=' + this.AffirmReleaseOrderStatus);
              } else {
                this.$message.error(res.data.errorMsg);
              }
            });
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      // 取消分派this.orderRowData
      cancelAssign (val, orderNumber) {
        this.cancelDialog = true;
        this.titleMsg = '你正在对 <label style="color: rgb(32, 160, 255);">' + orderNumber + '</label> 订单做取消分派的操作！请确认是否做取消操作';
        this.cancelDialogForm.order = {id: val};
        this.cancelDialogForm.receptionType = this.cancelDialogTitle = '取消分派';
        this.cancelDialogForm.receptionTypeId = '101020005';
      },
      // 取消确认
      cancelAffirm (val, orderNumber) {
        this.cancelDialog = true;
        this.titleMsg = '你正在对 <label style="color: rgb(32, 160, 255);">' + orderNumber + '</label> 订单做取消确认的操作！请确认是否做取消操作';
        this.cancelDialogForm.order = {id: val};
        this.cancelDialogForm.receptionType = this.cancelDialogTitle = '取消确认';
        this.cancelDialogForm.receptionTypeId = '101020004';
      },
      // 取消分派this.orderRowData
      cancelAssignv2 () {
        if (isEmpty(this.orderRowData)) {
          return this.$message.error('请选择数据');
        }
        if (this.orderRowData.length > 1) {
          return this.$message.error('无法支持多笔操作');
        }
        this.titleMsg = '你正在对 <label style="color: rgb(32, 160, 255);">' + this.orderRowData[0].orderNumber + '</label> 订单做取消分派的操作！请确认是否做取消操作';
        if (this.orderRowData[0].hasBilling === 111002001 || !this.orderRowData[0].showAssign) {
          return this.$message.error('该笔订单无法取消分派，原因可能是已开发票，对账单，或者已签收');
        }
        this.cancelDialog = true;
        this.cancelDialogForm.order = {id: this.orderRowData[0].id};
        this.cancelDialogForm.receptionType = this.cancelDialogTitle = '取消分派';
      },
      // 取消确认
      cancelAffirmv2 () {
        if (isEmpty(this.orderRowData)) {
          return this.$message.error('请选择数据');
        }
        if (this.orderRowData.length > 1) {
          return this.$message.error('无法支持多笔操作');
        }
        this.titleMsg = '你正在对 <label style="color: rgb(32, 160, 255);">' + this.orderRowData[0].orderNumber + '</label> 订单做取消确认的操作！请确认是否做取消操作';
        this.cancelDialog = true;
        this.cancelDialogForm.order = {id: this.orderRowData[0].id};
        this.cancelDialogForm.receptionType = this.cancelDialogTitle = '取消确认';
      },
      createClick (val) {
        if (isEmpty(this.cancelDialogForm.receptionDescribe)) {
          return this.$message.error('填写取消原因');
        }
        this.$refs['cancelDialogForm'].validate((valid) => {
          if (valid) {
            saveOrderReceptions(this.cancelDialogForm).then((res) => {
              if (res.data.successFlg) {
                this.cancelDialog = false;
                this.cancelDialogForm.receptionDescribe = null;
                this.searchOrdersByOrderStatus(this.fs);
                this.$message.success('保存成功');
              } else {
                this.$message.error('保存失败');
              }
            });
          }
        });
      },
      orderEnteringClick () {
        this.$router.push('/order/entering/');
      },
      // 标签打印
      printLabelOrder () {
        this.loadGetLodop();
        getOrderIdByLodop(this.orderIds).then((res) => {
          if (res.data.successFlg) {
            let orderLabel = res.data.detailModelList;
            for (let temp in orderLabel) {
              //LODOP.ADD_PRINT_IMAGE(30,150,400,400,"<img border='0' src='http://0.rc.xiniu.com/g1/M00/F8/1C/CgAGS1l6_A6AacsQAABGnDBF6EY641.jpg' />");//替换为URL
              LODOP.ADD_PRINT_IMAGE(12, 20, 160, 31, '<img border=\'0\' src=\'http://0.rc.xiniu.com/g1/M00/F8/1C/CgAGS1l6_A6AacsQAABGnDBF6EY641.jpg\' />'); // 本地图片
              //LODOP.ADD_PRINT_IMAGE(80,200,90,90,"E:/联盟速运/上线实施和运营/文件/报表/报表代码/lmsy_weixin.jpg"); //本地图片 去掉二维码
              LODOP.ADD_PRINT_TEXT(12, 154, 157, 25, '客服电话:400-897-5656');
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 9);
              LODOP.SET_PRINT_STYLEA(0, 'FontColor', 0);
              LODOP.ADD_PRINT_TEXT(26, 154, 157, 25, '在线查询:www.lmsy56.com');
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 9);
              LODOP.SET_PRINT_STYLEA(0, 'FontColor', 0);

              LODOP.SET_PRINT_STYLE('FontColor', 16711680);
              LODOP.ADD_PRINT_RECT(8, 15, '75mm', '44mm', 0, 2);//top 37,width 74 height 36 线宽为2
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 15);
              /*LODOP.ADD_PRINT_TEXT(15,180,157,25,"标准快运");//left 160
               LODOP.SET_PRINT_STYLEA(0,"FontName","隶书");
               LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
               LODOP.SET_PRINT_STYLEA(0,"FontColor",0);*/

              LODOP.SET_PRINT_STYLEA(0, 'FontColor', 0);
              LODOP.ADD_PRINT_TEXT(47, 25, 431, 20, '订单号');
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
              LODOP.ADD_PRINT_BARCODE(42, 95, 185, 30, '128Auto', orderLabel[temp].orderNumber);//left 75
              LODOP.ADD_PRINT_TEXT(75, 25, 431, 20, '收货人： ' + orderLabel[temp].sendContactName);
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
              LODOP.ADD_PRINT_TEXT(80, 155, 200, 20, '->' + orderLabel[temp].sendCity + orderLabel[temp].sendCounty);
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 13);
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);

              LODOP.ADD_PRINT_TEXT(95, 25, 431, 20, '货  名：' + orderLabel[temp].cargoNames);
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
              LODOP.ADD_PRINT_TEXT(115, 25, 200, 20, '件  数：' + orderLabel[temp].amount);
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
              //LODOP.ADD_PRINT_HTM(112,120,100,20,"(<font><span tdata='pageNO'>#</span>/<span tdata='pageCount'>#)</span></font>");
              //LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
              if (!isEmpty(orderLabel[temp].stowageCoreName)) {
                LODOP.ADD_PRINT_TEXT(115, 150, 160, 20, '  始发站:' + orderLabel[temp].stowageCoreName);
              } else {
                LODOP.ADD_PRINT_TEXT(115, 150, 160, 20, '  始发站:' + '');
              }
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
              LODOP.ADD_PRINT_TEXT(135, 25, 283, 40, '地  址：' + orderLabel[temp].sendAddress);
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
              //LODOP.ADD_PRINT_TEXT(155,25,431,20,"发货网点：厦门杏林");
              //LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
              LODOP.PREVIEW();
            }
          }
        });
      },
      // 保存 套打调整
      saveLotopInvoke () {
        this.currentLodopLeft = this.currentLodopLeft;
        this.currentLodopTop = this.currentLodopTop;
        this.lodopvisible = false;
      },
      lodopInvoke () {
        this.lodopvisible = true;
      },
      // 套打订单
      lodopOrder (Left, Top) {
        this.loadGetLodop();
        getOrderIdByLodop(this.orderIds).then((res) => {
          if (res.data.successFlg) {
            let orderLodop = res.data.detailModelList;
            console.log(orderLodop);
            for (let temp in orderLodop) {
              LODOP.PRINT_INITA(0, 0, '220mm', '110mm', '托运单打印');
              LODOP.SET_PRINT_PAGESIZE(1, '230mm', '140mm', 'CreateCustomPage');
//              LODOP.ADD_PRINT_TEXT(String(Top + 13.63) + "mm", String(Left + 158.78) + "mm", "23mm", "5.29mm", temp.id);// 运营网点
//              LODOP.ADD_PRINT_TEXT(String(Top + 13.63) + "mm", String(Left + 185.78) + "mm", "23mm", "5.29mm", temp.id);// 目的站
//              LODOP.ADD_PRINT_TEXT(String(Top + 30) + "mm", String(Left + 30) + "mm", "49.48mm", "5.29mm", orderLodop[temp].shipmentsAddress);// 发货单位
              LODOP.ADD_PRINT_TEXT(String(Top + 30) + 'mm', String(Left + 89) + 'mm', '18.52mm', '5.29mm', orderLodop[temp].shipmentsContactName);// 发货人
              LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              let shipmentsPhone = '';
              if (orderLodop[temp].shipmentsContactPhone !== null && orderLodop[temp].shipmentsContactPhone !== '' && orderLodop[temp].shipmentsContactPhone !== undefined) {
                shipmentsPhone = orderLodop[temp].shipmentsContactPhone;
              } else {
                shipmentsPhone = orderLodop[temp].shipmentsTelephone;
              }
              LODOP.ADD_PRINT_TEXT(String(Top + 35.5) + 'mm', String(Left + 30) + 'mm', '77.26mm', '5.29mm', shipmentsPhone);// 发货电话
              LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 41.5) + 'mm', String(Left + 28) + 'mm', '11.91mm', '5.29mm', orderLodop[temp].shipmentsProvince);// 发货省
              LODOP.ADD_PRINT_TEXT(String(Top + 41.5) + 'mm', String(Left + 44) + 'mm', '11.91mm', '5.29mm', orderLodop[temp].shipmentsCity);// 发货市
              LODOP.ADD_PRINT_TEXT(String(Top + 41.5) + 'mm', String(Left + 60) + 'mm', '11.91mm', '5.29mm', orderLodop[temp].shipmentsCounty);// 发货区县
              LODOP.ADD_PRINT_TEXT(String(Top + 48) + 'mm', String(Left + 14) + 'mm', '93.13mm', '5.29mm', orderLodop[temp].shipmentsAddress);// 发货详细地址
//              LODOP.ADD_PRINT_TEXT(String(Top + 58.5) + "mm", String(Left + 28) + "mm", "51.86mm", "5.29mm", orderLodop[temp].shouhdw);// 收货单位
              LODOP.ADD_PRINT_TEXT(String(Top + 59) + 'mm', String(Left + 88) + 'mm', '19.31mm', '5.29mm', orderLodop[temp].sendContactName);// 收货人
              LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              let sendPhone = '';
              if (orderLodop[temp].sendContactPhone !== null && orderLodop[temp].sendContactPhone !== '' && orderLodop[temp].sendContactPhone !== undefined) {
                sendPhone = orderLodop[temp].sendContactPhone;
              } else {
                sendPhone = orderLodop[temp].sendTelephone;
              }
              LODOP.ADD_PRINT_TEXT(String(Top + 64) + 'mm', String(Left + 30) + 'mm', '78.58mm', '5.29mm', sendPhone);// 收货电话
              LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 70.3) + 'mm', String(Left + 28) + 'mm', '11.91mm', '5.29mm', orderLodop[temp].sendProvince);// 收货省
              LODOP.ADD_PRINT_TEXT(String(Top + 70.3) + 'mm', String(Left + 44) + 'mm', '11.91mm', '5.29mm', orderLodop[temp].sendCity);// 收货市
              LODOP.ADD_PRINT_TEXT(String(Top + 70.3) + 'mm', String(Left + 60) + 'mm', '11.91mm', '5.29mm', orderLodop[temp].sendCounty);// 收货区县
              LODOP.ADD_PRINT_TEXT(String(Top + 77.3) + 'mm', String(Left + 14) + 'mm', '93.13mm', '5.29mm', orderLodop[temp].sendAddress);// 收货详细地址
              LODOP.ADD_PRINT_TEXT(String(Top + 92.15) + 'mm', String(Left + 24) + 'mm', '33.87mm', '5.29mm', orderLodop[temp].cargoNames);// 品名
              LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 92.55) + 'mm', String(Left + 75) + 'mm', '37.04mm', '5.29mm', orderLodop[temp].amount);// 件数
              LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 99.43) + 'mm', String(Left + 30) + 'mm', '27.78mm', '5.29mm', orderLodop[temp].weight);// 重量
              LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 99.69) + 'mm', String(Left + 86) + 'mm', '26.46mm', '5.29mm', orderLodop[temp].volume);// 体积
              LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              if (orderLodop[temp].packTypeNames === '木箱') {
                LODOP.ADD_PRINT_TEXT(String(Top + 106.3) + 'mm', String(Left + 32.55) + 'mm', '5.29mm', '5.29mm', '√');// 木箱
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              } else if (orderLodop[temp].packTypeNames === '纸箱') {
                LODOP.ADD_PRINT_TEXT(String(Top + 106.04) + 'mm', String(Left + 47.63) + 'mm', '5.29mm', '5.29mm', '√');// 纸箱
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              } else if (orderLodop[temp].packTypeNames === '托盘') {
                LODOP.ADD_PRINT_TEXT(String(Top + 106.04) + 'mm', String(Left + 62.45) + 'mm', '5.29mm', '5.29mm', '√');// 托盘
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              } else {
                LODOP.ADD_PRINT_TEXT(String(Top + 106.04) + 'mm', String(Left + 75.15) + 'mm', '5.29mm', '5.29mm', '√');// 其他
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                LODOP.ADD_PRINT_TEXT(String(Top + 105.04) + 'mm', String(Left + 88.15) + 'mm', '18mm', '5.29mm', orderLodop[temp].packTypeNames);// 其他包装名称
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
              if (orderLodop[temp].agingName === '标准快运') {
                LODOP.ADD_PRINT_TEXT(String(Top + 30.37) + 'mm', String(Left + 111.92) + 'mm', '5.29mm', '5.29mm', '√');// 标准快运
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
              if (orderLodop[temp].agingName === '定时快运') {
                LODOP.ADD_PRINT_TEXT(String(Top + 30.37) + 'mm', String(Left + 139.32) + 'mm', '5.29mm', '5.29mm', '√');// 定时快运
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
              if (orderLodop[temp].agingName === '定价快运') {
                LODOP.ADD_PRINT_TEXT(String(Top + 30.63) + 'mm', String(Left + 165.78) + 'mm', '5.29mm', '5.29mm', '√');// 定价快运
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
              if (orderLodop[temp].agingName === '整车快运') {
                LODOP.ADD_PRINT_TEXT(String(Top + 30.63) + 'mm', String(Left + 192) + 'mm', '4.76mm', '5.29mm', '√');// 整车快运
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 30);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
              if (orderLodop[temp].sendTypeName === '上门提货') {
                LODOP.ADD_PRINT_TEXT(String(Top + 44.89) + 'mm', String(Left + 112.5) + 'mm', '5.56mm', '5.29mm', '√');// 上门提货
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
              if (orderLodop[temp].sendTypeName === '送货上门') {
                LODOP.ADD_PRINT_TEXT(String(Top + 44.89) + 'mm', String(Left + 137.1) + 'mm', '5.56mm', '5.29mm', '√');// 送货上门
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
              let addValueArray = orderLodop[temp].addValues;
              if (addValueArray) {
                for (let addValueItem in addValueArray) {
                  if (addValueArray[addValueItem].value === '原件回单') {
                    LODOP.ADD_PRINT_TEXT(String(Top + 44.89) + 'mm', String(Left + 162.1) + 'mm', '5.29mm', '5.29mm', '√');// 签单返还
                    LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                    LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                    LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                  }
                  if (addValueArray[addValueItem].value === '等通知放货') {
                    LODOP.ADD_PRINT_TEXT(String(Top + 44.89) + 'mm', String(Left + 185.0) + 'mm', '6.09mm', '5.29mm', '√');// 等通知放货
                    LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                    LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                    LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                  }
                }
              }
              if (orderLodop[temp].orderCostPrice !== null) {
                LODOP.ADD_PRINT_TEXT(String(Top + 52.36) + 'mm', String(Left + 113.13) + 'mm', '5.29mm', '5.29mm', '√');// 货物保价
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                LODOP.ADD_PRINT_TEXT(String(Top + 52.04) + 'mm', String(Left + 142.7) + 'mm', '15.88mm', '5.29mm', orderLodop[temp].orderCostPrice);// 投保价值
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
              if (orderLodop[temp].orderCostAmount !== null) {
                LODOP.ADD_PRINT_TEXT(String(Top + 52.36) + 'mm', String(Left + 159.2) + 'mm', '5.03mm', '5.29mm', '√');// 保价费
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                LODOP.ADD_PRINT_TEXT(String(Top + 52.04) + 'mm', String(Left + 174.77) + 'mm', '18.52mm', '5.29mm', orderLodop[temp].orderCostAmount);// 保价费
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                if (orderLodop[temp].messageServiceMoney > 0) {
                  LODOP.ADD_PRINT_TEXT(String(Top + 60.84) + 'mm', String(Left + 112.13) + 'mm', '5.03mm', '5.29mm', '√');// 信息服务费
                  LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                  LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                  LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                  LODOP.ADD_PRINT_TEXT(String(Top + 60.74) + 'mm', String(Left + 134.5) + 'mm', '16.14mm', '5.29mm', orderLodop[temp].messageServiceMoney);// 信息服务费
                  LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                  LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
                  LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                }
                // LODOP.ADD_PRINT_TEXT(String(Top + 60.83) + "mm", String(Left + 159.0) + "mm", "5.03mm", "5.29mm", orderLodop[temp].baozf);// 包装费
//              LODOP.ADD_PRINT_TEXT(String(Top + 60.8) + "mm", String(Left + 175.51) + "mm", "19.31mm", "5.29mm", orderLodop[temp].baozf$);// 包装费
                //
              }
              if (orderLodop[temp].paymentTypeName === '现付') {
                LODOP.ADD_PRINT_TEXT(String(Top + 104.49) + 'mm', String(Left + 112.65) + 'mm', '5.03mm', '5.29mm', '√');// 现金付
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
              if (orderLodop[temp].paymentTypeName === '到付') {
                LODOP.ADD_PRINT_TEXT(String(Top + 104.49) + 'mm', String(Left + 134.35) + 'mm', '5.29mm', '5.29mm', '√');// 货到付
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
              if (orderLodop[temp].paymentTypeName === '回单结') {
                LODOP.ADD_PRINT_TEXT(String(Top + 104.49) + 'mm', String(Left + 155.05) + 'mm', '4.76mm', '5.29mm', '√');// 回单付
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
              if (orderLodop[temp].paymentTypeName === '回单结') {
                LODOP.ADD_PRINT_TEXT(String(Top + 104.49) + 'mm', String(Left + 155.05) + 'mm', '4.76mm', '5.29mm', '√');// 回单付
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
              if (orderLodop[temp].paymentTypeName === '月结30天') {
                LODOP.ADD_PRINT_TEXT(String(Top + 104.39) + 'mm', String(Left + 194.47) + 'mm', '5.82mm', '5.29mm', '√');// 月结45天
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                LODOP.ADD_PRINT_TEXT(String(Top + 104.50) + 'mm', String(Left + 178.8) + 'mm', '5.03mm', '7mm', '30');// 月结
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
              if (orderLodop[temp].paymentTypeName === '月结45天') {
                LODOP.ADD_PRINT_TEXT(String(Top + 104.39) + 'mm', String(Left + 194.47) + 'mm', '5.82mm', '5.29mm', '√');// 月结45天
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                LODOP.ADD_PRINT_TEXT(String(Top + 104.50) + 'mm', String(Left + 178.8) + 'mm', '5.03mm', '7mm', '45');// 月结
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
              if (orderLodop[temp].paymentTypeName === '月结90天') {
                LODOP.ADD_PRINT_TEXT(String(Top + 104.39) + 'mm', String(Left + 194.47) + 'mm', '5.82mm', '5.29mm', '√');// 月结45天
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                LODOP.ADD_PRINT_TEXT(String(Top + 104.50) + 'mm', String(Left + 178.8) + 'mm', '5.03mm', '7mm', '90');// 月结
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
              if (orderLodop[temp].collectPaymentAmount > 0) {
                LODOP.ADD_PRINT_TEXT(String(Top + 70.36) + 'mm', String(Left + 112.33) + 'mm', '4.76mm', '5.29mm', '√');// 代收货款
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                LODOP.ADD_PRINT_TEXT(String(Top + 69.53) + 'mm', String(Left + 131.59) + 'mm', '21.7mm', '5.29mm', orderLodop[temp].collectPaymentAmount);// 代收货款
                LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
                LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                LODOP.ADD_PRINT_TEXT(String(Top + 71.09) + 'mm', String(Left + 157.25) + 'mm', '5.56mm', '5.29mm', orderLodop[temp].collectionWan);// 代收货款：万
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                LODOP.ADD_PRINT_TEXT(String(Top + 71.09) + 'mm', String(Left + 165.19) + 'mm', '5.56mm', '5.29mm', orderLodop[temp].collectionQian);// 代收货款：千
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                LODOP.ADD_PRINT_TEXT(String(Top + 71.09) + 'mm', String(Left + 173.19) + 'mm', '5.56mm', '5.29mm', orderLodop[temp].collectionBai);// 代收货款：百
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                LODOP.ADD_PRINT_TEXT(String(Top + 71.09) + 'mm', String(Left + 181.65) + 'mm', '5.29mm', '5.29mm', orderLodop[temp].collectionShi);// 代收货款：十
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                LODOP.ADD_PRINT_TEXT(String(Top + 71.09) + 'mm', String(Left + 189.85) + 'mm', '5.29mm', '5.29mm', orderLodop[temp].collectionYuan);// 代收货款：元
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
                LODOP.ADD_PRINT_TEXT(String(Top + 71.09) + 'mm', String(Left + 199.59) + 'mm', '5.56mm', '5.29mm', orderLodop[temp].collectionJiao);// 代收货款：角
                LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              }
//              LODOP.ADD_PRINT_TEXT(String(Top + 89.61) + 'mm', String(Left + 121.59) + 'mm', '20.37mm', '5.29mm', orderLodop[temp].freightoney);// 运费
//              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 89.61) + 'mm', String(Left + 154.08) + 'mm', '22.49mm', '5.29mm', orderLodop[temp].shortPickUpMoney);// 提货费
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 89.61) + 'mm', String(Left + 186.89) + 'mm', '22.23mm', '5.29mm', orderLodop[temp].shortDeliveryMoney);// 送货费
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 95.78) + 'mm', String(Left + 129.47) + 'mm', '26.46mm', '5.29mm', orderLodop[temp].totalMoney);// 运杂费总计
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 96.81) + 'mm', String(Left + 155.52) + 'mm', '5.29mm', '5.29mm', orderLodop[temp].totalWan);// 总计：万
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 96.78) + 'mm', String(Left + 164.72) + 'mm', '5.56mm', '5.29mm', orderLodop[temp].totalQian);// 总计：千
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 96.78) + 'mm', String(Left + 172.71) + 'mm', '5.03mm', '5.29mm', orderLodop[temp].totalBai);// 总计：百
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 96.80) + 'mm', String(Left + 180.25) + 'mm', '6.09mm', '5.29mm', orderLodop[temp].totalShi);// 总计：十
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 96.80) + 'mm', String(Left + 190.0) + 'mm', '4.76mm', '5.29mm', orderLodop[temp].totalYuan);// 总计：元
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 96.80) + 'mm', String(Left + 198.0) + 'mm', '5.29mm', '5.29mm', orderLodop[temp].totalJiao);// 总计：角
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 115.18) + 'mm', String(Left + 164.84) + 'mm', '40.22mm', '21.43mm', '单号');
              LODOP.ADD_PRINT_TEXT(String(Top + 115.18) + 'mm', String(Left + 172.84) + 'mm', '40.22mm', '21.43mm', orderLodop[temp].orderNumber);// 订单编号
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 118.6) + 'mm', String(Left + 164.84) + 'mm', '40.22mm', '21.43mm', '经办人');
              LODOP.ADD_PRINT_TEXT(String(Top + 118.6) + 'mm', String(Left + 174.84) + 'mm', '40.22mm', '21.43mm', orderLodop[temp].orderManager);// 经办人
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 122.02) + 'mm', String(Left + 164.84) + 'mm', '40.22mm', '21.43mm', orderLodop[temp].remark);// 备注
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);
              LODOP.ADD_PRINT_TEXT(String(Top + 131) + 'mm', String(Left + 19) + 'mm', '93.13mm', '5.29mm', orderLodop[temp].submitTime);// 提交日期
              LODOP.SET_PRINT_STYLEA(0, 'FontName', '宋体');
              LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10);
              LODOP.SET_PRINT_STYLEA(0, 'Bold', 1);

              LODOP.PREVIEW();
            }
          }
        });
      },
      tableRowClassName (o) {
        return o.row.agingDictEntityId === 112006003 ? 'info-row' : '';
      },
      // lhq 测试导出
      orderExport () {
        searchOrdersNoPage({
          filters: 'NOTEQ_isDelete=111002001;',
          sorts: '-createDate'
        }).then((res) => {
          if (res.data.successFlg) {
            console.log(res.data.detailModelList[0]);
            this.$ue.downloadFile(res.data.detailModelList.map(item => [item.orderNumber, item.freightNumber, item.memberUserName, item.shipmentsContactName, item.shipmentsContactPhone, item.sendAddress, item.sendContactName, item.sendContactPhone, item.shipmentsAddress, item.partnerName, item.sendRegion, item.amount, item.weight, item.volume, item.createDate, item.cargoNames, item.extractDate, item.orderPrice, item.isOriginalCopy, item.receiptStatusName, item.paymentTypeName]), ['订单编号 ', '运单号', '客户', '发货人姓名', '发货人电话', '发货人地址', '收货人姓名', '收货人电话', '收货人地址', '事业合伙人', '目的地', '件数', '重量', '体积', '下单时间', '货品名称', '计划提货时间', '运费', '是否原件回单', '回单是否返还', '结算类型'], '订单管理导出文件');
          } else {
            return this.$message.error('目前暂无数据，无法导出');
          }
        });
      },
      /**
       * 查看订单
       */
      orderSelectDialog (val) {
        this.orderSelect = true;
        this.orderSelectForm = val;
      },
      /**
       * 订单接待录入
       */
      rowOrderReceptionEnteringDialog (val) {
        this.orderReceptionEnteringDialog(val);
      },
      seOrderReceptionEnteringDialog (val) {
        if (isEmpty(val)) {
          return this.$message.error('请选择订单');
        }
        val = val.substring(0, val.length - 1);
        if (val.split(',').length > 1) {
          return this.$message.error('无法进行多笔操作，请重新选择');
        }
        let rowData = this.orderRowData[0];
        if (rowData.orderStatus !== 101001002) {
          return this.$message.error('非待确认订单，无法操作');
        }
        this.orderReceptionEnteringDialog(val);
      },
      orderReceptionEnteringDialog (val) {
        this.$router.push('/order/receptionEntering/' + val);
      },
      /**
       * 修改订单
       */
      orderModifyCli (id) {
        this.$router.push('/order/orderModify/' + id);
      },
      orderModifyClick (id) {
        if (isEmpty(id)) {
          return this.$message.error('请选择你需要修改的订单');
        }
        let sp = id.substring(id.length - 1, id.length);
        if (sp === ',') {
          id = id.substring(0, id.length - 1);
        }
        if (id.split(',').length > 1) {
          return this.$message.error('无法进行多笔修改');
        }
        if (this.orderRowData[0].orderStatus === 101001001 || this.orderRowData[0].orderStatus === 101001002) {
          return this.$message.error(this.orderRowData[0].orderStatusName + '状态无法修改');
        }
        if (this.orderRowData[0].single) {
          return this.$message.error('该笔订单已拆单，无法修改');
        }
        this.$router.push('/order/orderModify/' + id);
      },
      /**
       * 删除订单
       */
      deleteOrder (id, isDelete, warningMsg, msg) {
        if (isEmpty(id)) {
          return this.$message.error('请选择您要更改的订单');
        }
        this.$confirm(warningMsg, {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          // （物理删除）
          if (isDelete === 'notarizeDelete') {
            notarizeDeleteOrder(this.token, id).then((res) => {
              if (res.data.successFlg) {
                this.$message.success(msg);
                this.searchOrdersByOrderStatus('EQ_isDelete=111002001');
              }
            });
          } else {
            // （逻辑删除）
            deleteOrder(this.token, id, isDelete).then((res) => {
              if (res.data.successFlg) {
                this.$message.success(msg);
                this.searchOrdersByOrderStatus(this.fs);
              }
            });
          }
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消操作'
          });
        });
      },
      /**
       * 反馈跟踪
       */
      feedbackTrackingDialog () {
        this.feedbackTracking = true;
      },

      /**
       * 表格多选
       */
      scOrders (orders) {
        this.orderIds = [];
        this.orderAging = [];
        this.orderRowData = orders;
        for (let order in orders) {
          this.orderIds.push(orders[order].id);
          this.orderAging.push(orders[order].agingDictEntityId);
        }
        this.orderIds = this.orderIds.join();
      },
      orderAssignDialog (sr, row, refresh) {
        this.refresh = refresh;
        let data = '';
        if (row !== 'row') {
          if (sr === '' || sr === undefined || sr == null) {
            return this.$message.error('请选择您要确认&分派的订单');
          }
          if (sr.substring(0, sr.length - 1).split(',').length > 1) {
            return this.$message.error('无法进行多笔操作，请重新选择');
          }
          if (this.orderAging[0] === 112006004) {
            return this.$message.error('无法对合同快运进行分派操作，请重新选择');
          }
          data = this.orderRowData[0];
        } else {
          data = sr;
          this.orderIds = data.id;
        }
        this.selectDispatchCentre = true;
        let startAddress = [];
        let endAddress = [];
        startAddress.push(data.shipmentsProvinceId);
        startAddress.push(data.shipmentsCityId);
        startAddress.push(data.shipmentsCountyId);
        endAddress.push(data.sendProvinceId);
        endAddress.push(data.sendCityId);
        endAddress.push(data.sendCountyId);

        searchMarkCargoNoPage({
          startAddress: startAddress.join(),
          endAddress: endAddress.join(),
          sorts: ''
        }).then((res) => {
          this.dispatchCentreData = res.data.detailModelList;
        });
      },
      /**
       * 订单分派+确认&订单分派
       */
      orderAssignAndPayableAndTask (row) {
        this.seLoading = true;
        this.selectDispatchCentre = false;
        let orderId = this.orderIds;
        let sp = orderId.substring(orderId.length - 1, orderId.length);
        if (sp === ',') {
          orderId = orderId.substring(0, orderId.length - 1);
        }
        let id = row.id;
        let name = row.name;
        let assignOrganizationId = row.organizationIdLast;
        let assignOrganizationName = row.organizationName;
        let stowageCoreIdLast = row.stowageCoreIdLast;
        let stowageCoreName = row.stowageCoreName;
        orderAssignAndPayableAndTask(this.token, orderId, id, name, assignOrganizationId, assignOrganizationName, stowageCoreIdLast, stowageCoreName).then((res) => {
          this.seLoading = false;
          if (res.data.successFlg) {
            this.$message.success('订单分派成功');
            this.searchOrdersByOrderStatus('EQ_orderStatus=' + this.refresh);
          } else {
            this.$message.error(res.data.errorMsg);
          }
        });
      },
      orderReverse (id, status, refresh, msg) {
        if (isEmpty(id)) {
          return this.$message.error('请选择您要更改的订单');
        }

        this.$confirm('您确认要改变该订单状态', {
          type: 'warning'
        }).then(() => {
          orderReverse(this.token, id, status).then((res) => {
            console.log(res);
            if (res.data.successFlg) {
              this.$message.success(msg);
              this.searchOrdersByOrderStatus('EQ_orderStatus=' + refresh);
            }
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消操作'
          });
        });
      },
      orderRefund (id) {
        if (isEmpty(id)) {
          return this.$message.error('请选择您要退款的订单');
        }

        this.$confirm('您确认要该订单一定要退款吗，按下去钱就没了？想清楚了吗？', {
          type: 'warning'
        }).then(() => {
          doOrderRefund(id).then((res) => {
            if (res.data.successFlg) {
              this.searchOrdersByOrderStatus(this.fs);
            } else {
              this.$message.error(res.data.errorMsg);
            }
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消操作'
          });
        });
      },

      // 确认操作，修改状态，后台对应生成应付数据----提交操作也可，待测试（生成应收数据）
      updateOrderStatus (ids, status, refresh, msg) {
        if (isEmpty(ids)) {
          return this.$message.error('请选择您要更改的订单');
        }
        this.$confirm('您确认要改变该订单状态', {
          type: 'warning'
        }).then(() => {
          updateOrderStatus(this.token, ids, status).then((res) => {
            if (res.data.successFlg) {
              this.$message.success(msg);
              this.searchOrdersByOrderStatus('EQ_orderStatus=' + refresh);
            }
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消操作'
          });
        });
      },
      searchOrderSource () {
        getDictEntityByDictCode({token: this.token, dictCode: 101004}).then((res) => {
          this.orderSources = res.data.detailModelList;
        });
      },
      searchOrdersByOrderStatus (filters) {
        this.fs = ';' + filters;
        this.isModify = this.isAwaitSubmit = this.isAwaitAssert = this.isAwaitPay = this.isAwaitAssign = this.isAwaitExtract = this.isDelete = true;
        if (isEmpty(filters)) {
        } else if (filters === 'EQ_orderStatus=101001001;EQ_isDelete=111002002;') {
          this.isModify = this.isAwaitAssert = this.isAwaitPay = this.isAwaitAssign = this.isAwaitExtract = this.isDelete = true;
          this.isAwaitSubmit = false;
        } else if (filters === 'EQ_orderStatus=101001002;EQ_isDelete=111002002;') {
          this.isModify = this.isAwaitPay = this.isAwaitAssign = this.isAwaitExtract = true;
          this.isAwaitAssert = this.isAwaitSubmit = false;
          this.isDelete = true;
        } else if (filters === 'payStatus=101003001') {
          this.isAwaitPay = false;
          this.isAwaitSubmit = this.isAwaitAssert = this.isAwaitAssign = this.isAwaitExtract = this.isDelete = true;
        } else if (filters === 'EQ_orderStatus=101001003;') {
          this.isAwaitAssign = false;
          this.isAwaitPay = this.isAwaitSubmit = this.isAwaitAssert = this.isAwaitExtract = this.isDelete = true;
        } else if (filters === 'EQ_orderStatus=101001004;EQ_extractType=105002001;' || filters === 'EQ_orderStatus=101001005;' || filters === 'EQ_orderStatus=101001006;') {
          this.isAwaitExtract = false;
          this.isAwaitAssign = this.isAwaitPay = this.isAwaitSubmit = this.isAwaitAssert = this.isDelete = true;
        } else if (filters === 'EQ_isDelete=111002001;') {
          this.isDelete = false;
          this.isModify = this.isAwaitExtract = this.isAwaitAssign = this.isAwaitPay = this.isAwaitSubmit = this.isAwaitAssert = true;
        }
        console.log(filters);
        this.searchOrders();
      },

      /**
       * 多条件检索订单信息
       */
      searchOrders () {
        let o = Object.assign({}, this.searchForm);
        if (o.GT_createDate) {
          o.GTE_createDate = o.GT_createDate.substr(0, 10) + ' 00:00:00';
          delete o.GT_createDate;
        }
        if (o.LT_createDate) {
          o.LTE_createDate = o.LT_createDate.substr(0, 10) + ' 23:59:59';
          delete o.LT_createDate;
        }
        let filters = objToFilter(o);
        filters = isEmpty(this.fs) ? filters : filters + this.fs;
        filters = filters.replace('EQ_currentSpecialLineIds', 'LIKE_trunkTasks.currentSpecialLineIds') + ';NOTEQ_orderStatus=101001012';
        this.searchOrderTable(filters);
      },

      /**
       * 检索订单信息
       * @param filters
       */
      searchOrderTable (filters) {
        console.log(filters);
        getOrderTableData({
          filters: filters,
          sorts: '-createDate',
          size: this.pageSize,
          page: this.currentPage
        }).then((res) => {
          if (res.data.successFlg) {
            if (isEmpty(this.orderNumbers.all)) {
              this.orderNumbers.all = res.data.totalCount;
            }
            this.orderTableData = res.data.detailModelList;
            this.currentPage = res.data.currPage;
            this.total = res.data.totalCount;
            this.pageSize = res.data.pageSize;
          }
        });
        let orderStatusFilters = {
          101001001: 'EQ_orderStatus=101001001;EQ_isDelete=111002002;', // 待提交
          101001002: 'EQ_orderStatus=101001002;EQ_isDelete=111002002;', // 待确认
          101003002: 'EQ_payStatus=101003001;NOTEQ_isDelete=111002001', // 待支付
          101001003: 'EQ_orderStatus=101001003;', // 待分派
          101001004: 'EQ_orderStatus=101001004;EQ_extractType=105002001;', // 待提货
          101001005: 'EQ_orderStatus=101001005;', // 待发运
          101001006: 'EQ_orderStatus=101001006;', // 待签收
          101001007: 'EQ_orderStatus=101001007;', // 待评价
          101001011: 'EQ_orderStatus=101001011;', // 已完成
          111002001: 'EQ_isDelete=111002001;'// 回收站
        };
        searchOrderNumbers({
          token: this.token,
          filters: JSON.stringify(orderStatusFilters),
          sorts: ''
        }).then((res) => {
          let numData = res.data.detailModelList;
          for (let ons in numData) {
            switch (numData[ons].orderStatus) {
              case '101001001':
                // 待提价
                this.orderNumbers.dtj = numData[ons].orderStatusNumber === '' ? 0 : numData[ons].orderStatusNumber;
                break;
              case '101001002':
                // 待确认
                this.orderNumbers.dqr = numData[ons].orderStatusNumber === '' ? 0 : numData[ons].orderStatusNumber;
                break;
              case '101003002':
                // 待支付
                this.orderNumbers.dzf = numData[ons].orderStatusNumber === '' ? 0 : numData[ons].orderStatusNumber;
                break;
              case '101001003':
                // 待分派
                this.orderNumbers.dfp = numData[ons].orderStatusNumber === '' ? 0 : numData[ons].orderStatusNumber;
                break;
              case '101001004':
                // 待提货
                this.orderNumbers.dth = numData[ons].orderStatusNumber === '' ? 0 : numData[ons].orderStatusNumber;
                break;
              case '111002001':
                // 回收站
                this.orderNumbers.hsz = numData[ons].orderStatusNumber === '' ? 0 : numData[ons].orderStatusNumber;
                break;
              case '101001005':
                // 待发运
                this.orderNumbers.dfy = numData[ons].orderStatusNumber === '' ? 0 : numData[ons].orderStatusNumber;
                break;
              case '101001006':
                // 待签收
                this.orderNumbers.dqs = numData[ons].orderStatusNumber === '' ? 0 : numData[ons].orderStatusNumber;
                break;
              case '101001007':
                // 待评价
                this.orderNumbers.dpj = numData[ons].orderStatusNumber === '' ? 0 : numData[ons].orderStatusNumber;
                break;
              case '101001011':
                // 已完成
                this.orderNumbers.ywc = numData[ons].orderStatusNumber === '' ? 0 : numData[ons].orderStatusNumber;
                break;
            }
          }
        });
      },
      // 载入打印信息
      loadGetLodop () {
        getLodop();
      },
      // 每页几条操作
      handleSizeChange (val) {
        this.pageSize = val;
        this.searchOrders();
      },
      // 第几页操作
      handleCurrentChange (val) {
        this.currentPage = val;
        this.searchOrders();
      },
      resetSearchForm (formName) {
        this.$refs[formName].resetFields();
      }
    },
    computed: {
      btns () {
        return this.$store.state.btns[this.$route.path] || [];
      },
      querys () {
        return this.$store.state.querys[this.$route.path + '#default'] || [];
      }
    },
    mounted () {
      this.$store.commit('initDict');
      this.$store.commit('initOrganizations');
      this.searchOrders();
    }
  };
</script>
